<%-- 
    Document   : Detail
    Created on : Dec 4, 2012, 9:57:34 AM
    Author     : Quang Thao
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    String[] query = request.getQueryString().split("&");
    String mode = query[0].split("=")[1];
    String isbn = query[1].split("=")[1];
    BO.BookBO bookBO = new BO.BookBO();
    Bean.BookBean book = new Bean.BookBean();
    
    book = bookBO.GetInfo(isbn);
    if (mode.equals("user"))
    {
        %>
               <html>
                    <head>
                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                        <title>Detail book</title>
                        <%@include file="../LayoutUser/InHead.jsp" %>
                    </head>
                    <body>
                        <div id="wrapper">
                            <%@include file="../LayoutUser/Top.jsp" %>
                            <div id="middle">
                                <%@include file="../LayoutUser/Middle_Top.jsp" %>
                                <div class="left">
                                    <br>
                                    <input id="Button1" type="button" value="Trở về" 
                                           onclick="javascript:history.back()" class="Button1"/>
                                    &nbsp
                                    <a href="<%= "Detail.jsp?isbn=" + book.getISBN()%>">
                                        <input type="button" value="Mua hàng" name="btnBuy" class="Button1"/>
                                    </a>
                                    <br>
                                    <br>
                                    <table class="TableDetail">
                                        <tr>
                                            <th colspan="2">
                                                <h1>
                                                    <%= book.getName()%>
                                                </h1>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td class="First">
                                                <img src="<% out.print("../../Content/Images/Book/" + book.getPicture());%>"/>
                                            </td>
                                            <td>
                                                ISBN :
                                                <%= book.getISBN()%>
                                                <br>
                                                Tác giả :
                                                <%= book.getAuthor()%>
                                                <br>
                                                Giá : 
                                                <%= String.format("%,4.0f VNĐ",book.getCost())%>
                                                <br />
                                                Thể loại : 
                                                <%= book.getType().getName()%>
                                                <br>
                                                Nhà xuất bản : 
                                                <%= book.getPublisher()%>
                                                <br>
                                                Năm xuất bản :
                                                <%= book.getYear()%>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                Mô tả :
                                                <br>
                                                <%= book.getDescribe()%>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <%@include file="../LayoutUser/Middle_Right.jsp" %>
                            </div>
                            <%@include file="../LayoutUser/Bottom.jsp" %>
                        </div>
                    </body>
                </html>
                <%
    }
%>

